Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIFF: add support for FillOrder == 2 #2936

Merged
merged 2 commits into from
Sep 13, 2017

Conversation

melissalinkert
Copy link
Member

See https://trac.openmicroscopy.org/ome/ticket/4166

This updates TiffParser to use Integer.reverse(int) to reverse the bits in each byte of a tile when the FillOrder tag is set to 2. The reversal is performed immediately after the tile buffer is read from the file, before any decompression or unpacking takes place. An extra check is added to the tile reading logic, so that the special case of returning a single raw tile is never used for FillOrder == 2.

This is a much simpler approach than either of the fixes proposed on the ticket, as it does not require any additional API or changes to other components. It should be safe for a patch release, but is not urgent and can be deferred if needed.

To test, use the data_repo/curated/tiff/john/C100915-MA_AXIS_LEH_IMAGE_KIND_FLAT_ICE_3.tif file. Without this change, showinf should result in an image with vertical black and white pinstripes. With this change, showinf should show a smooth gradient, matching the results of ImageMagick's display command.

@sbesson
Copy link
Member

sbesson commented Aug 20, 2017

This change seems to have affected the repository tests - see https://ci.openmicroscopy.org/view/Failing/job/BIOFORMATS-DEV-merge-full-repository/620. Marking as breaking for now.

@melissalinkert
Copy link
Member Author

Test failure should be fixed with a722516

@sbesson
Copy link
Member

sbesson commented Sep 4, 2017

Removing the breaking label for inclusion into the daily builds.

@sbesson sbesson removed the breaking label Sep 4, 2017
@mtbc
Copy link
Member

mtbc commented Sep 6, 2017

Interestingly ImageJ 1.51i also has the pinstripe problem.

Copy link
Member

@mtbc mtbc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution but may be tomorrow before we know what BIOFORMATS-DEV-merge-full-repository-win thinks of it.

@mtbc
Copy link
Member

mtbc commented Sep 6, 2017

Local testing goes just as expected without and with this PR.

@sbesson sbesson modified the milestone: 5.7.1 Sep 7, 2017
@sbesson sbesson merged commit cd38bef into ome:develop Sep 13, 2017
@melissalinkert melissalinkert deleted the tiff-fill-order branch October 24, 2017 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants